﻿@using CID.Web.Support
@model CID.Web.Models.Operations.ServerAssignmentViewModel
@using (Html.KOBeginFormChildEditor("AssignmentEdition"))
{
    @Html.ValidationSummary(true)
    <fieldset class="innerEditor">
        <legend>Edit Assignment</legend>

        <div class="editor-label">
            @Html.LabelFor(m => m.Server)
        </div>
        <div class="editor-field">
            @Html.KODropDownListForEntity(m => m.ServerId, m => m.Server, Model.AvailableServers, Model.ServerId)
            @Html.ValidationMessageFor(m => m.ServerId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(m => m.ServerRole)
        </div>
        <div class="editor-field">
            @Html.KODropDownListForEntity(m => m.ServerRoleId, m => m.ServerRole, Model.AvailableServerRoles, Model.ServerRoleId)
            @Html.ValidationMessageFor(m => m.ServerRoleId)
        </div>

        @Html.KOHiddenFor(m => m.Id)
        @Html.KOHiddenFor(m => m.EnvironmentId)

        <p>
            <input type="button" value="Apply" data-bind="click: Apply, enable: IsValid"/>
            <input type="button" value="Cancel" data-bind="click: Cancel"/>
        </p>
    </fieldset>
}
